@extends('admin::layouts.master')
@section('title')
    积分订单详情
@endsection
<style>
</style>
@section('tab')
    <div style="padding: 20px; background-color: #F2F2F2; ">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-header">商户信息</div>
                    <div class="layui-card-body" >
                        LOGO：<img src="{{$info['shop_info']['logo']['full_src']}}" style="width: 80px; height: 80px;" /><br>
                        公司名称：{{$info['shop_info']['company_name']}} <br>
                        商户类型：{{$info['cate']==1?'检测站':'维修店'}}<br>
                        服务类型：
                                @foreach( $info['shop_info']['types'] as $item)
                                    {{$item['name']}} &nbsp; &nbsp;
                                @endforeach
                                <br>
                        {{--商户照片：{{$data['shop_info']['level_name']}}<br>--}}
                        商户地址：{{$info['shop_info']['province_name']['name']}}-{{$info['shop_info']['city_name']['name']}}-{{$info['shop_info']['area_name']['name']}}-{{$info['shop_info']['address']}}<br>
                        老板名称：@if( !empty($info['shop_info']['name_boss'])) {{$info['shop_info']['name_boss']}} @else - @endif<br>
                        老板电话：@if( !empty($info['shop_info']['phone'])) {{$info['shop_info']['phone']}} @else - @endif<br>
                        营业执照：@if( !empty( $info['shop_info']['img']['full_src'] ) ) <img src="{{$info['shop_info']['img']['full_src']}}" style="width: 80px; height: 80px;" class="Look_img" title="点击查看大图" />@else - @endif<br>
                        创建时间：{{$info['shop_info']['created_at']}}<br>
                        门店照片：
                        @foreach( $info['shop_info']['shop_img'] as $key => $vo )
                            <img src="{{$vo['img']['full_src']}}" style="width: 80px; height: 80px;" class="Look_img" title="点击查看大图"  />
                        @endforeach
                        <br>
                        账户状态：{{$info['shop_info']['status']==1?'正常':'禁用'}}<br>
                    </div>
                </div>
            </div>


            <div class="layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-header" style="height: auto;">申请变更后的信息 -【 审核状态： {{$info['status']['name']}} 】@if( $info['status']['id'] != 1 ) - 【审核说明：{{$info['remark']}}】 @endif </div>
                    <div class="layui-card-body" >
                        LOGO：<img src="{{$info['shop_info']['logo']['full_src']}}" style="width: 80px; height: 80px;" /><br>
                        公司名称：{{$info['company_name']}} <br>
                        商户类型：{{$info['cate']==1?'检测站':'维修店'}}<br>
                        服务类型：
                        @foreach( $info['shop_info']['types'] as $item)
                            {{$item['name']}} &nbsp; &nbsp;
                        @endforeach
                        <br>
                        {{--商户照片：{{$data['shop_info']['level_name']}}<br>--}}
                        商户地址：{{$info['province_name']['name']}}-{{$info['city_name']['name']}}-{{$info['area_name']['name']}}-{{$info['address']}}<br>
                        老板名称：@if( !empty($info['name_boss'])) {{$info['name_boss']}} @else - @endif<br>
                        老板电话：@if( !empty($info['phone'])) {{$info['phone']}} @else - @endif<br>
                        营业执照：@if( !empty( $info['img']['full_src'] ) ) <img src="{{$info['img']['full_src']}}" style="width: 80px; height: 80px;" class="Look_img" title="点击查看大图" />@else - @endif<br>
                        申请时间：{{$info['created_at']}}<br>
                        门店照片：
                            @foreach( $info['shop_modify_img'] as $key => $vo )
                             <img src="{{$vo['img']['full_src']}}" style="width: 80px; height: 80px;" class="Look_img" title="点击查看大图" />
                            @endforeach
                    </div>
                    @if( $info['status']['id'] == 1 )
                    <div class="layui-form-item" style="padding-bottom: 50px; margin-left: 20%;">
                        <label for="L_repass" class="layui-form-label"></label>
                        <button class="layui-btn"  lay-skin="switch" lay-filter="switchTest" id="fdsfs" data-id="{{$info['id']}}">通过审核</button>
                        <button class="layui-btn"  lay-skin="switch" lay-filter="switchTest" id="oipoip" data-id="{{$info['id']}}">驳回审核</button>
                    </div>
                    @endif
                </div>
            </div>

        </div>
    </div>

@endsection

@section('tab_js')
    <script>
        layui.use(['form', 'layer', 'jquery'], function () {
            $ = layui.jquery;
            var form = layui.form,
                layer = layui.layer;

            //点击图片查看大图
            var bigImgIndex = null;
            $("body").on('click','.Look_img',function(){
                var img_src = $(this).attr('src');
                var img_infor = "<img width='500px' height='600px' border='0' src='" + img_src + "' />";
                bigImgIndex = layer.open({
                    content:img_infor,
                    type:1,
                    area:['auto'],
                    shadeClose: true,
                    shade:[0.4, '#000000'],
                    title:false,
                    closeBtn:true
                });
            });


            $("body").on('click','#fdsfs',function(){
                var id = $(this).attr('data-id');
                layer.prompt({title: '请填写审核备注信息', formType: 2}, function(content, index){
                            $.ajax({
                                url: js_url('admin-shop-modify-shenhe'),
                                type: 'post',
                                data: {id:id,remark:content,'_token': '{{csrf_token()}}','type':2},
                                dataType: "json",
                                success: function (result) {
                                    if (result.state === 0) {
                                        layer.msg(result.msg, {time: 1000, icon: 1}, function () {
                                            window.parent.location.reload()//刷新父页面
                                        });
                                    } else {
                                        layer.msg(result.msg, {time: 2000, icon: 5});
                                    }
                                }
                            });
                        });
            })


            $("body").on('click','#oipoip',function(){
                var id = $(this).attr('data-id');
                layer.prompt({title: '请填写审核备注信息', formType: 2}, function(content, index){
                    $.ajax({
                        url: js_url('admin-shop-modify-shenhe'),
                        type: 'post',
                        data: {id:id,remark:content,'_token': '{{csrf_token()}}','type':3},
                        dataType: "json",
                        success: function (result) {
                            if (result.state === 0) {
                                layer.msg(result.msg, {time: 1000, icon: 1}, function () {
                                    window.parent.location.reload()//刷新父页面
                                });
                            } else {
                                layer.msg(result.msg, {time: 2000, icon: 5});
                                xadmin.close();
                                xadmin.father_reload();
                            }
                        }
                    });
                });
            })


        })
    </script>
@endsection
